<me:UIWBBST x:Class="WPFExcelReport.TDIWB25"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBDAT" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                   x:Name="TV" 
                    Loaded="Window_Loaded"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:M2YD x:Key="M2YD"/>
    </me:UIWBBST.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions> 
        <DataGrid  Grid.Row="1"  Grid.Column="0"
                   VerticalAlignment="Top"   
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=类型}}" Foreground="Red" Binding="{Binding WBBWAKZ}"/>
                <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=布卷号}}" Binding="{Binding WBBSTKNR,Converter={StaticResource pnum}}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=库区}}" Binding="{Binding WBBLB}"  Width="40"/> 
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(米)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}"/>  
                <DataGridTextColumn  IsReadOnly="True"  Binding="{Binding Path=WBBAUFKRS}"  Width="Auto"/>
                <DataGridTextColumn  IsReadOnly="True"  Binding="{Binding Path=WBBAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=留位至}}"  Width="Auto"/>
                <DataGridTextColumn  IsReadOnly="True"  Binding="{Binding Path=WBBAUFPOS,Converter={StaticResource pnum}}"   Width="Auto" />
                <DataGridTextColumn   IsReadOnly="True"  Header="{Binding Source={Localization:Translate Word=原卷号}}" Binding="{Binding WBBDPART2}"   Width="40"/>
                <DataGridTextColumn Binding="{Binding Path=WBBBEM,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
        <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
        <WrapPanel Grid.Row="3">
            <ex:TSUMWB/>
        </WrapPanel>
    </Grid>
</me:UIWBBST>
